package com.bibrApp.difu.utils;

import android.content.Context;

import java.util.HashMap;
import java.util.Map;

/**
 * @author dj
 * @date 2012/3/2
 */
public class BiBrShare {
  private static BiBrShare mShare;
  private Map<String, ShareUtils> maShareMap;

  private BiBrShare() {
    maShareMap = new HashMap<>();
  }

  public static synchronized ShareUtils getShare(Context context, String key) {
    if (mShare == null) {
      synchronized (BiBrShare.class) {
        if (mShare == null) {
          mShare = new BiBrShare();
        }
      }
    }
    ShareUtils share = mShare.maShareMap.get(key);
    if (share == null) {
      share = new ShareUtils(context, key);
      mShare.maShareMap.put(key, share);
    }
    return share;
  }
}
